package mark.tom.fiter.json;

import androidx.annotation.NonNull;

import org.json.JSONException;
import org.json.JSONObject;

public class BaseJSONObject extends JSONObject {

    public BaseJSONObject() {
        super();
    }

    public BaseJSONObject(String json) throws JSONException {
        super(json);
    }

    public JSONObject accumulate(@NonNull String key, Object value) {
        try {
            return super.accumulate(key, value);
        } catch (Exception ex) {
            // Ignore
        }
        return this;
    }

    @Override
    public JSONObject put(@NonNull String name, boolean value) {
        try {
            return super.put(name, value);
        } catch (Exception ex) {
            // Ignore
        }
        return this;
    }

    @Override
    public JSONObject put(@NonNull String name, double value) {
        try {
            return super.put(name, value);
        } catch (Exception ex) {
            // Ignore
        }
        return this;
    }

    @Override
    public JSONObject put(@NonNull String name, int value) {
        try {
            return super.put(name, value);
        } catch (Exception ex) {
            // Ignore
        }
        return this;
    }

    @Override
    public JSONObject put(@NonNull String name, long value) {
        try {
            return super.put(name, value);
        } catch (Exception ex) {
            // Ignore
        }
        return this;
    }

    @Override
    public JSONObject put(@NonNull String name, Object value) {
        try {
            return super.put(name, value);
        } catch (Exception ex) {
            // Ignore
        }
        return this;
    }

}
